From 5b4eaf21a984b04eb77e5b8948b9ef4e3e97d468 Mon Sep 17 00:00:00 2001 From: Ralf Horstmann Date: Sun, 19 Jan 2020 23:28:12 +0100 Subject: [PATCH] Add OpenBSD support to qmake project (#464) * Add OpenBSD support to qmake project * Set HAVE_LINUX_HID only on Linux in CMakeLists.txt --- CMakeLists.txt | 5 ++++- GPSBabel.pro | 9 ++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 91f785de7..044e7eb95 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -219,8 +219,11 @@ if(MSVC) add_compile_options(/MP -wd4100) endif() -if (UNIX AND NOT APPLE) +if (CMAKE_SYSTEM_NAME MATCHES "Linux") add_definitions(-DHAVE_LINUX_HID) +endif() + +if (UNIX AND NOT APPLE) set(LIBS ${LIBS} usb-1.0) endif() diff --git a/GPSBabel.pro b/GPSBabel.pro index 10172a359..d08db3e17 100644 --- a/GPSBabel.pro +++ b/GPSBabel.pro @@ -172,7 +172,7 @@ load(configure) CONFIG(release, debug|release): DEFINES *= NDEBUG -macx|linux { +macx|linux|openbsd { qtCompileTest(unistd) { # this is used by zlib DEFINES += HAVE_UNISTD_H @@ -207,6 +207,9 @@ win32-msvc* { linux { DEFINES += HAVE_LINUX_HID +} + +linux|openbsd { LIBS += "-lusb-1.0" } @@ -249,14 +252,14 @@ DEFINES += CSVFMTS_ENABLED QMAKE_CFLAGS_WARN_ON -= -W QMAKE_CXXFLAGS_WARN_ON -= -W -macx|linux{ +macx|linux|openbsd{ check.commands = PNAME=./$(TARGET) ./testo check.depends = $(TARGET) QMAKE_EXTRA_TARGETS += check } # build the compilation data base used by clang tools including clang-tidy. -macx|linux{ +macx|linux|openbsd{ compile_command_database.target = compile_commands.json compile_command_database.commands = make clean; bear make QMAKE_EXTRA_TARGETS += compile_command_database -- 2.30.2